package com.example.chasshelper;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;

import com.example.chasshelper.dao.ClassroomDao;
import com.example.chasshelper.dao.CourseDao;
import com.example.chasshelper.dao.MessageDao;
import com.example.chasshelper.dao.RegistrationDao;
import com.example.chasshelper.dao.SolutionDao;
import com.example.chasshelper.dao.StudentDao;
import com.example.chasshelper.dao.TeacherDao;
import com.example.chasshelper.dao.TestDao;
import com.example.chasshelper.utils.DaoUtils;

public class ForgetActivity extends AppCompatActivity implements View.OnClickListener {
    private static final String TAG = ForgetActivity.class.getSimpleName();
    private final Activity mContext = ForgetActivity.this;
    //控件
    private Button btn_back;
    private Button btn_query;
    private EditText et_userAccount;
    private EditText et_phone;
    //dao
    private TeacherDao teacherDao= DaoUtils.getTeacherDao();
    private StudentDao studentDao=DaoUtils.getStudentDao();
    private CourseDao courseDao=DaoUtils.getCourseDao();
    private ClassroomDao classroomDao=DaoUtils.getClassroomDao();
    private RegistrationDao registrationDao=DaoUtils.getRegistrationDao();
    private SolutionDao solutionDao = DaoUtils.getSolutionDao();
    private MessageDao messageDao = DaoUtils.getMessageDao();
    private TestDao testDao = DaoUtils.getTestDao();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_forget);
        initUI();
        initData();
    }

    private void initUI() {
        //绑定控件
        btn_back = findViewById(R.id.btn_back);
        btn_query = findViewById(R.id.btn_query);
        et_userAccount = findViewById(R.id.et_userAccount);
        et_phone = findViewById(R.id.et_phone);
        //点击事件
        btn_back.setOnClickListener(this);
        btn_query.setOnClickListener(this);
    }

    private void initData() {
        //dao实例化

        //adapter实例化
    }

    @Override
    public void onClick(View view) {
        Intent intent = new Intent();
        String userAccount = et_userAccount.getText().toString();
        String phone = et_phone.getText().toString();
        //测试
        System.out.println("账号："+userAccount+"手机号："+phone);
        switch (view.getId()) {
            case R.id.btn_back://返回上一页
                finish();
                break;
            case R.id.btn_query://查询密码
                Toast.makeText(mContext,"查询密码",Toast.LENGTH_SHORT).show();
                break;
        }
    }
}